﻿CREATE PROCEDURE [dbo].[usp_select_Faults_By_Application_And_Services]
(
        @Application		varchar(255)	= NULL
	   ,@ServiceName		varchar(255)	= NULL
	   ,@StartDate			datetime		= NULL
	   ,@EndDate			datetime		= NULL
)
AS

SET NOCOUNT ON;
--SET @EndDate = DATEADD(day,1,@EndDate)

select 
  Fault.*
from dbo.Fault
where 
	[Application] = @Application 
and [ServiceName] = @ServiceName
and [DateTime] between @StartDate and @EndDate
order by [Application], [ServiceName]


SET NOCOUNT OFF;
